| Total Complexity | 1 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | 4 | export const enum TokenType { |
|
| 9 | |||
| 10 | /** |
||
| 11 | * @class Token |
||
| 12 | * @name Token |
||
| 13 | */ |
||
| 14 | 4 | export class Token { |
|
| 15 | type: TokenType |
||
| 16 | s: string |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Initialize a token. |
||
| 20 | */ |
||
| 21 | constructor(type: TokenType, s: string) { |
||
| 22 | 32 | this.type = type |
|
| 23 | 32 | this.s = s |
|
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * The text representation. |
||
| 28 | */ |
||
| 29 | toString(): string { |
||
| 30 | 1 | return `${this.type}(${this.s})` |
|
| 31 | } |
||
| 35 |